#pragma once

class BaseObjectView : public CWnd
{
	// Construction
public:
// 	Ogre::Root           *m_OgreRoot;
// 	Ogre::Camera         *m_Camera;
// 	Ogre::RenderWindow   *m_Window;
// 	Ogre::SceneManager   *m_SceneManager;
// 	Ogre::MovableObject         *		 m_DisplayHandle;
	bool                  m_OgreInitialised;
	bool                  m_UpdateNeeded;
	std::string          m_name;
	//BaseObjectView() { m_OgreRoot = 0;m_Camera = 0;m_Window = 0;m_SceneManager = 0;m_DisplayHandle = 0;m_OgreInitialised = false;m_UpdateNeeded = true;};
	virtual ~BaseObjectView() {};
	virtual void     SetupOgre();
	void     LoadEditorObjects();
	void     TerminateOgre();
  	void     AdjustCamera();
 virtual	void     DisplayHandle(std::string name);

protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	DECLARE_MESSAGE_MAP()
};



class ParticleObjectView : public BaseObjectView
{

public:
	ParticleObjectView(const std::string & name = "particle") {m_DisplayParticle = NULL; m_name= name;};
	virtual ~ParticleObjectView() {};

	virtual void     SetupOgre();
protected:
	//virtual	void     AdjustCamera();
	virtual	void     DisplayHandle(std::string name);
	//Ogre::ParticleSystem         * m_DisplayParticle;
};

enum OBJECTTYPE
{
   OBJRCT_PARTICLE,
   OBJECT_ENTITY,
   OBJECT_NPC
};

class basePane
{
public:

 virtual	void CreateDockingWindows() = 0;
  virtual	void SetupOgre() = 0;
 virtual	void ShowPane(CString &name) = 0;
 virtual	void OnPaint() = 0;
 virtual void	ReloadUserResources() = 0;
 virtual void   TerminateScene() = 0;

};



class AddParticleWnd : public CDockablePane ,public basePane
{
	// Construction
public:
	AddParticleWnd();

	// Attributes
public:
	CListBox    m_wndList;
	BaseObjectView * m_wndObjectView;
	CButton     m_AddButton;
	CFont       m_Font;
	CString     m_SelectedObject;
	void chanageObject(OBJECTTYPE objecttype);
	void SetUpdateNeeded(bool value) {m_wndObjectView->m_UpdateNeeded = value;};
	bool GetUpdateNeeded() {return m_wndObjectView->m_UpdateNeeded;};
	//Ogre::RenderWindow *GetRenderWindow() {return m_wndObjectView->m_Window;};
//

	virtual	void	CreateDockingWindows(CDockablePane* pTabControlBarAttachTo);
	virtual	void	SetupOgre();
	virtual	void	ShowPane(CString &name);
	virtual	void	OnPaint();
	virtual void	ReloadUserResources() ;
	virtual void	TerminateScene() ;

protected:

	// Implementation
public:
	virtual ~AddParticleWnd();
	afx_msg void OnSelectionChanged();

protected:
	afx_msg int		OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void	OnSize(UINT nType, int cx, int cy);
	afx_msg void	OnClose();
	afx_msg void	OnAddToSceneClick();
	afx_msg void	OnUpdateAddBtn(CCmdUI *pCmdUI);
	DECLARE_MESSAGE_MAP()
};

